var $j = jQuery.noConflict();
$j(document).ready(function($) {
	init();
});

function init() {
	$j(".datatable").dataTable({
		"sDom" : '<"H"lfri>t<"F"p>',
		"sPaginationType" : "full_numbers"
	});

	var wid = $j(window).width();
	$j(".node").dialog({
		position : [ "center", "center" ],
		width : wid * .95,
		minHeight : 400,
		title : "All Organizations",
		closeOnEscape : false,
		dialogClass : "noClose"
	});
	$j(".fg-toolbar").width($j(".datatable").width() - ($j(".fg-toolbar").css("paddingLeft").replace("px", "") * 2));

	$j(".newDialog").live("click", function(e) {
		e.preventDefault();
		$j.get($j(e.target).attr("href"), function(data) {
			$j(data).dialog({
				position : [ "center", "center" ],
				width : 300,
				minHeight : 200,
				title : "View Contact",
			});
			$j(".contactdi").dialog("moveToTop");
		});
	});
}